{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

{{#modal-dialog
  close="closeDirectoryViewer"
  translucentOverlay=true
  clickOutsideToClose=false
  container-class="modal-dialog"}}
  <div class="modal-content hdfs-viewer">
    <div class="modal-header">
      <div class="text-info">
        <button type="button" class="close" {{action "closeDirectoryViewer"}}>&times;</button>
        <h4 class="modal-title">{{fa-icon "database" size="lg"}} Select location</h4>
      </div>
      {{#if (and showSelectedPath hdfsLocation)}}
        <p><strong>Current path:</strong> {{hdfsLocation}}</p>
      {{/if}}

    </div>
    <div class="modal-body">
      <div class="hdfs-viewer-wrap">
        {{directory-viewer
          config=config
          errorAction="viewerError"
          pathSelectAction="viewerSelectedPath"
        }}
      </div>
    </div>

    <div class="modal-footer">
      <button type="button" class="btn btn-default" {{action "closeDirectoryViewer"}}>{{fa-icon "times"}} Close</button>
      <button type="button" class="btn btn-primary" {{action "pathSelected"}}>{{fa-icon "check"}} Select</button>
    </div>
  </div><!-- /.modal-content -->
{{/modal-dialog}}
